home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / int24h.zip / INT24H.ASM < prev   
Assembly Source File  |  1993-01-04  |  1KB  |  52 lines

  1. Comment *
  2. ZDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD?
  3. 3 Title   : int24hnd                                 3
  4. 3 Purpose : This procedure is an interrupt handler which installed, bypasses 3
  5. 3        the abort retry ignore messages and returns the error code to    3
  6. 3        the program using the Inter program communications area at         3
  7. 3        0x40:0xF0. See the dos tech reference manual for details about   3
  8. 3        how this works.                             3
  9. 3                                         3
  10. 3    Written by Jack Zucker - 75766,1336    301-794-5950             3
  11. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDY
  12.  *
  13.     assume cs:_text
  14. _text    segment public byte 'code'
  15.     public _int24hnd
  16.  
  17. _int24hnd  proc near
  18.                 ; at this point, the first 3 words on the
  19.                 ; stack are:
  20.                 ; IP,CS,Flags as a result of the Failed
  21.                 ; dos call.
  22.  
  23.     add sp,06h;        ; Discard dos stack info
  24.  
  25.     push ds         ; place error code in ICA area
  26.     push bx
  27.     mov bx,40h        ; segment of ICA
  28.     mov ds,bx
  29.     mov bx,0f0h        ; offset of ICA
  30.     mov [bx],di        ; put error code in ICA
  31.     pop bx
  32.     pop ds
  33.  
  34.     pop ax            ; pop all registers
  35.     pop bx
  36.     pop cx
  37.     pop dx
  38.     pop si
  39.     pop di
  40.     pop bp
  41.     pop ds
  42.     pop es
  43.                 ; Now whats left on the stack is:
  44.                 ; IP,CS,Flags of the guy who called
  45.                 ; the dos interrupt in the first place
  46.                 ; so lets return to him !
  47.  
  48.     iret            ; return to who called the int 21h
  49. _int24hnd  endp
  50. _text    ends
  51. end